home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 24
/
Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso
/
Aminet
/
biz
/
cloan
/
pprx_WAD.lha
/
WebAnimDesigner1_2d
/
WebAnimDesigner.pprx
< prev
next >
Wrap
Text File
|
1998-01-20
|
34KB
|
1,136 lines
/* Personal Paint Amiga Rexx script - Copyright © 1997-8, Andres Paabo. 'SaveAnimGif.pprx 1.7 script is copyright Cloanto (see bottom portion of this script)*/
/* $VER: WebAnimDesigner.pprx 1.2d */
/** ENG
This script is intended to assist in the creation of animated gifs for web pages.
NOTE this program does not create animated gifs itslf. It only helps design the anim or
animbrush that is used as a source for creating the animated gifs. The animated gifs
have to be created with other programs such as Cloanto's DefineAnimGif.pprx and
SaveAnimGif.pprx. However since this runs on Personal Paint. and for convenience, this
script will call on Personal Paint's 'SaveAnimGif.pprx' (in slightly modified form) and
pass information to it.
*/
IF ARG(1, EXISTS) THEN
PARSE ARG PPPORT
ELSE
PPPORT = 'PPAINT'
IF ~SHOW('P', PPPORT) THEN DO
IF EXISTS('PPaint:PPaint') THEN DO
ADDRESS COMMAND 'Run >NIL: PPaint:PPaint'
DO 30 WHILE ~SHOW('P',PPPORT)
ADDRESS COMMAND 'Wait >NIL: 1 SEC'
END
END
ELSE DO
SAY "Personal Paint could not be loaded."
EXIT 10
END
END
IF ~SHOW('P', PPPORT) THEN DO
SAY 'Personal Paint Rexx port could not be opened'
EXIT 10
END
ADDRESS VALUE PPPORT
OPTIONS RESULTS
OPTIONS FAILAT 10000
/*********ANIM IS SET UP****WHAT TO DO NEXT***************************/
openWAD= getclip('openWAD')
if openWAD = "" then DO
/*******************ENSURES SCREEN NOT TOO SMALL & STUFF IS WITHIN SCREEN*****************/
accept = 0
GET 'SCREENW'
scw = result
if scw >= 640 then DO
GET 'SCREENH'
sch = result
if sch >= 400 then DO
GET 'IMAGEW'
imgw = result
if imgw <= scw then DO
GET 'IMAGEH'
imgh = result
if imgh <= sch then accept = 1
END
END
END
if accept = 0 then DO
Requestnotify 'TITLE "CHANGE SCREEN or IMAGE SIZE" PROMPT "For viewability, screen
size must be 640x 400 or greater, and image size equal or less the screen size"'
EXIT 0
END
/********/
call setclip('openWAD', 1)
END
/********THE ABOVE IS DONE ONLY AT VERY START****IF OPENWAD =""****/
numcolors2=getclip('numcolors2')
GET 'COLORS'
numcolors=result
if numcolors = 256 then DO; RequestResponse 'PROMPT "You must start on the source page.
Proceed if okay. Cancel if not."';if rc~=0 then EXIT 0;END
if numcolors = numcolors2 then DO
switchenvironment
GET 'COLORS'
numcolors=result
end
SETFRAMEPOSITION 1
Set '"BARS=0"'
REQUESTER:
txt_gad_title = 'WEB ANIM DESIGNER 1.2 by A.Paabo for use with Personal Paint 7.+'
txt_gad_transp = 'transparency'
txt_gad_dispose = 'dispose'
txt_gad_optimize = 'Optimization:'
txt_gad_optimnone = '1.None (Constant size & position)'
txt_gad_optimdelta = '3.Deltas (Varying size & position)'
txt_gad_optimbndy= '2.Boundaries (Varying size & position)'
txt_gad_operation = 'SELECT OPERATION:'
txtnew = 'WEBANIMDESIGNER OPERATES ON THE CURRENT ANIMATION'
txt_gad_preview = '1.SIMULATE animgif in 2nd environment'
txt_gad_anbrush = 'Special Operations '
txt_gad_anbrushnone = '(When selected, overrides above operations)'
txt_gad_pickup = '2.pick up web anim as annotated animbrush'
txt_gad_animload = '1.make current animbrush into WAD anim'
txt_gad_removecolor = '3.make-no background color in object'
txt_gad_final = '2.MAKE ANIMGIF via Cloanto SaveAnimGif'
txt_gad_drawrect = 'simulation:show frame rectangles'
txt_gad_curglobal = 'define global rectangle'
txt_gad_curglobal0 = '(use current global rectangle) '
txt_gad_curglobal1 = '1.let WAD determine new from anim'
txt_gad_curglobal2 = '2. User-define new with mouse'
txt_gad_loop = 'loops (0=endless):'
transpcol = getclip('transpcol'); if transpcol = "" then transpcol=0
X0 = getclip('X0')
Y0 = getclip('Y0')
X1 = getclip('X1')
Y1 = getclip('Y1')
GETFRAMES
frames=result
transp=getclip('transp')
if transp = "" then transp = 1
dispose = getclip('dispose')
if dispose = "" then dispose = 1
optimization= getclip('optimization')
if optimization="" then optimization = 0
drawrect= getclip('drawrect')
if drawrect="" then drawrect=1
/*curglobal = getclip('curglobal')
if curglobal="" then*/
curglobal=0
anbrush=0
loop = getclip('loop')
if loop = "" then loop = 0
operation = getclip('operation')
if operation = "" then operation =0
Request '"'txt_gad_title'" ' ||,
' "TEXT = ""'txtnew'"" '||,
' INTSTR = ""'txt_gad_loop'"", 0, 32767, 'loop' ' ||,
' CHECK = ""'txt_gad_transp'"", 'transp' ' ||,
' CHECK = ""'txt_gad_dispose'"", 'dispose' ' ||,
' CYCLE = ""'txt_gad_optimize'"", 3, 'optimization', ""'txt_gad_optimnone'"",""'txt_gad_optimbndy'"", ""'txt_gad_optimdelta'"" ' ||,
' CYCLE = ""'txt_gad_curglobal'"", 3, 'curglobal', ""'txt_gad_curglobal0'"", ""'txt_gad_curglobal1'"", ""'txt_gad_curglobal2'"" ' ||,
' VSPACE = 8 ' ||,
' CYCLE = ""'txt_gad_operation'"", 2, 'operation',""'txt_gad_preview'"", ""'txt_gad_final'"" '||,
' VSPACE = 8 ' ||,
' CHECK = ""'txt_gad_drawrect'"", 'drawrect' ' ||,
' SEPARATOR ' ||,
' CYCLE = ""'txt_gad_anbrush'"", 4, 'anbrush', ""'txt_gad_anbrushnone'"", ""'txt_gad_animload'"", ""'txt_gad_pickup'"", ""'txt_gad_removecolor'"" "'
if rc~=0 then DO;SET '"BARS=0x3"'; EXIT 0;END
if rc = 0 then DO
loop = RESULT.1
transp = RESULT.2
dispose = RESULT.3
optimization = RESULT.4
curglobal = RESULT.5
operation = RESULT.6
drawrect = RESULT.7
anbrush = RESULT.8
END
call setclip('loop' , loop)
call setclip('transp', transp)
call setclip('dispose', dispose)
call setclip('operation', operation)
call setclip('optimization', optimization)
call setclip('drawrect', drawrect)
call setclip('curglobal', curglobal)
call setclip('anbrush', anbrush)
if anbrush = 1 then DO
GetBrushAttributes 'FRAMES'
frames = RESULT
IF frames < 2 then DO
Requestnotify 'PROMPT "You selected animbrush but there is no animbrush present.
We exit."'
SET '"BARS=0x3"'
EXIT 0
END
if frames ~< 2 then call BRUSHLOADER
END
if anbrush = 2 then DO
Getframes
frames = result
if frames < 2 then DO
Requestnotify 'PROMPT "You selected to pick up an animbrush but there is no animation present"'
SET '"BARS=0x3"'
EXIT
END
if X0 = "" then DO
Requestnotify 'PROMPT "No global rectangle is defined. We do not know what area to pick up."'
SET '"BARS=0x3"'
EXIT
END
call PICKUPABRUSH /*does not continue to save as there is an anbrush=2 block*/
END
if anbrush=3 then call MAKEOPAQUE
if transp= 0 then SET '"TRANSP=0"'
if transp=1 then SET '"TRANSP=1"'
Getframes
frames = result
if frames <2 then DO
Requestnotify 'PROMPT "There is no animation to work on. Load an animation, or make
one from animbrush"'
SET '"BARS=0x3"'
EXIT
END
if curglobal = 0 then DO
if X0 = "" then DO
Requestnotify 'PROMPT "There is no previous global rectangle
definition. You must define the global rectangle. Try again."'
SET '"BARS=0x3"'
EXIT
END
END
if curglobal = 1 then call GLOBALAREA
if curglobal = 2 then call DEFINERECT
if operation = 1 then CALL PICKUPABRUSH /*saveanimgif bypasses it all*/
if optimization = 1 then DO
if transp =0 then Requestnotify 'PROMPT "Boundaries optimization in settings other
than transp=1 and dispose=1 may produce a webanim result different from the source Amiga
animation."'
END
if optimization = 2 then DO
if transp =1 then Requestnotify 'PROMPT "Deltas optimization in settings other than
transp=0 and dispose=0 may produce a webanim result different from the source Amiga
animation."'
END
SWITCHENVIRONMENT
DELETEFRAMES ALL FORCE
CLEARIMAGE
if numcolors < 256 then numcolors2 = numcolors*2
if numcolors = 256 then numcolors2 = numcolors
Set 'FORCE "COLORS='numcolors2'"'
col = '153 153 153'
col2 = '204 204 204'
Setcolors 'FROM "'numcolors2-1'" COLORS "'col'"'
Setcolors 'FROM "'numcolors2-2'" C